/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.hazard.setting.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.hopes.bizz.hazard.common.constant.enums.HazardSysDictEnum;
import com.hopes.boss.admin.api.resolver.DictResolver;
import com.hopes.boss.admin.api.resolver.enums.AdminDictEnum;
import com.hopes.boss.admin.api.resolver.enums.SysDictEnum;
import com.hopes.boss.common.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 监控因子设置
 *
 * @author daijie
 * @date 2023-10-31 16:52:06
 */
@Data
@TableName(value = "haz_basic_factor_config", excludeProperty = "tenantId")
@EqualsAndHashCode(callSuper = true)
@Schema(description = "监控因子设置")
public class HazBasicFactorConfigEntity extends BaseEntity {

    private static final long serialVersionUID = 1L;


    /**
     * ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    @Schema(description = "ID")
    private Long id;

    /**
     * 所属企业
     */
    @Schema(description = "所属企业")
    private Long orgId;

    /**
     * 模块
     */
    @Schema(description = "模块")
    private String moduleCode;

    /**
     * 因子类型
     */
    @Schema(description = "因子类型")
    private String factorType;

    /**
     * 名称
     */
    @Schema(description = "名称")
    private String name;

    /**
     * 缩略名
     */
    @Schema(description = "缩略名")
    private String shortName;

    /**
     * 编码
     */
    @Schema(description = "编码")
    private String code;

    /**
     * 计量单位
     */
    @Schema(description = "计量单位")
    private String unitName;

    /**
     * 是否启用
     */
    @Schema(description = "是否启用")
    private Boolean useFlag;

    /**
     * 序号
     */
    @Schema(description = "序号")
    private Integer sortNum;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remarks;

    /**
     * 扩展字段1
     */
    @Schema(description = "扩展字段1")
    private String ext1;

    /**
     * 扩展字段2
     */
    @Schema(description = "扩展字段2")
    private String ext2;


    public String getOrgIdStr() {
        return DictResolver.getItemLabelByValue(AdminDictEnum.sys_company, this.getOrgId());
    }

    public String getModuleCodeStr() {
        return DictResolver.getItemLabelByValue(HazardSysDictEnum.park_factor_module, this.moduleCode);
    }

    public String getFactorTypeStr() {
        return DictResolver.getItemLabelByValue(HazardSysDictEnum.park_factor_type, this.factorType);
    }

    public String getUseFlagStr() {
        return DictResolver.getItemLabelByValue(SysDictEnum.yes_no_type, this.useFlag);
    }
}
